<template>
  <div id="app">
  <router-view />
  </div>
</template>

<script>


export default {
        name: 'App',
        created() {
             this.localSocket();
        },
        components: {},
		methods: {
			localSocket() {
				//console.log('zhangqx')
                let that = this;
                if ("WebSocket" in window) {
                    console.log("您的浏览器支持WebSocket!");
                    that.ws = new WebSocket("ws://127.0.0.1:7415");     
                    that.global.setWs(that.ws);
                    // that.ws.onopen = that.onopen();
                    that.ws.onclose = function () {

                        if(that.ws.readyState==0){
                            setTimeout(() => {
                            that.localSocket();
                        }, 5000);
                            
                        }
                        // 关闭 websocket
                       
                    };
                } else {
                    // 浏览器不支持 WebSocket
                    console.log("您的浏览器不支持WebSocket!");
                }
            },
        }
    }
</script>

<style lang="scss">


  .position-left {
  	  left: 190px;
  	}
  	.position-collapse-left{
  		left:64px !important;
  	}

  .uploadcol {
  	display: flex;
  	flex-flow: column;

  }

  .uploadborder {
  	border: 1px dashed #d9d9d9;
  	border-radius: 6px;
  	justify-content: center;
  	align-items: center;
  	display: flex;

  	i {
  		color: #f1f1f1;
  		font-size: 20px;
  	}

  }

  .drawer-main {
  	.close {
  		width: 40px;
  		height: 60px;
  		position: absolute;
  		left: -40px;
  		top: 46%;
  		background-color: #FFFFFF;
  		cursor: pointer;
  		padding: 15px 5px;
  		border-bottom-left-radius: 8px;
  		border-top-left-radius: 8px;

  		i {
  			font-size: 30px;
  			color: #777;
  		}
  	}

  	.el-drawer {
  		outline: none;
  		overflow: visible;

  		/deep/ .el-drawer__container {
  			outline: none;
  		}
  	}

  	.add-box {
  		width: 100%;
  		height: calc(100% - 50px);

  	}
	.add-boxs{
		width: 100%;
		height: calc(100% - 140px);
	}
  }
  .drawerfooter {
  	display: flex;
  	margin-left: 20px;
  	margin-right: 20px;
  	justify-content: flex-end;

  	.el-button {
  		width: 45%;
  	}
  }

</style>
